<@_sysDatasource id=id><#assign a=object/><#assign p=properties/></@_sysDatasource>
<form method="post" autocomplete="off" action="sysDatasource/save?callbackType=closeCurrent&navTabId=sysDatasource/list" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
            <li><button type="submit" class="buttonActive" title="ctrl+s"><@t.page 'button.save'/></button></li>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
    <div class="pageContent">
        <div class="pageFormContent" layoutH="56">
            <dl>
                <dt><@t.page 'name'/>:</dt>
                <dd><input class="required" name="name" type="text" size="30" value="${(a.name)!}"/><label><#if !a?has_content><input name="initDatabase" type="checkbox" value="true"/>initDatabase</label></#if></dd>
            </dl>
            <dl class="nowrap">
                <dt><@t.page 'url'/>:</dt>
                <dd><input class="required" name="url" type="text" size="80" value="${(p['jdbc.url'])!'jdbc:mysql://127.0.0.1:3306/publiccms?characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&useAffectedRows=true&serverTimezone=GMT%2B08'}"/></dd>
            </dl>
            <dl class="nowrap">
                <dt>Driver classname:</dt>
                <dd><input class="required" name="driverClassName" type="text" size="30" value="${(p['jdbc.driverClassName'])!'com.mysql.cj.jdbc.Driver'}"/></dd>
            </dl>
            <dl>
                <dt><@t.page 'user.username'/>:</dt>
                <dd><input class="required" name="username" type="text" size="30" value="${(p['jdbc.username'])!'publiccms'}"/></dd>
            </dl>
            <dl>
                <dt><@t.page 'password'/>:</dt>
                <dd><input class="required" name="password" type="text" size="30" value="<#if !a?has_content>publiccms</#if>"/></dd>
            </dl>
            <dl>
                <dt>Min pool size:</dt>
                <dd><input class="required" name="minPoolSize" type="number" size="30" value="${(p['hikariCP.minPoolSize'])!5}"/></dd>
            </dl>
            <dl>
                <dt>Max pool size:</dt>
                <dd><input class="required" name="maxPoolSize" type="number" size="30" value="${(p['hikariCP.maxPoolSize'])!90}"/></dd>
            </dl>
            <div class="clearfix"></div>
            <fieldset>
                <legend><i class="icon-sitemap icon-large"></i> <@t.page 'site'/></legend>
                <ul class="tree treeFolder treeCheck">
            <@_sysSiteList>
                <#list page.list as a>
                    <li>
                        <a tname="siteIds" tvalue="${a.id}">${a.name}</a>
                        <@_sysSiteList parentId=a.id>
                            <#if page.totalCount gt 0>
                                <ul>
                            <#list page.list as a>
                                <li><a tname="siteIds" tvalue="${a.id}">${a.name}</a></li>
                            </#list>
                                </ul>
                            </#if>
                        </@_sysSiteList>
                    </li>
                </#list>
            </@_sysSiteList>
                </ul>
         <#if a?has_content>
           <script>
        <@_sysSiteDatasourceList>
        <#list list as a>
    $('.tree li a[tname=siteIds][tvalue=${a.id.siteId?js_string}]',navTab.getCurrentPanel()).attr('checked','true');
        </#list>
        </@_sysSiteDatasourceList>
            </script>
        </#if>
            </fieldset>
        </div>
    </div>
</form>